﻿<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="com.cg.slms.domain.*,java.util.*"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%
	if (request.getAttribute("employee") == null) {
		Employee employee = new Employee();
		request.setAttribute("employee", employee);
	}
%>

<html>
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>员工档案</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script language="javascript" src="script/main.js"></script>
<script language="javascript">
	function deleteRecord(url) {
		if (window.confirm("确定要删除选中的记录吗？")) {
			window.location=url;
		}
	}
</script>
</head>
<body>
	<div style="text-align: center;">
		
		<br>
		<div class="modify" style="position:relative;">	
			<form:form action="employeeAction" method="post" modelAttribute="employee">
				<table border="0" cellpadding="1" cellspacing="1" width="95%" style="margin-top:50px">
					<tr>
						<td align="right" width="10%">员工编号</td>
						<td width="20%"><form:input path="code" class="form-control"></form:input></td>
						<td align="right" width="10%">员工名称</td>
						<td width="20%"><form:input path="name" class="form-control"></form:input></td>
						<td width="40%">&nbsp;</td>
					</tr>
					<tr>
						<td align="right" width="10%">&nbsp;</td>
						<td width="20%">&nbsp;</td>
						<td width="70%" colspan="5">&nbsp;</td>
					</tr>
				</table>
			
				<p></p>
				<div style="margin-left: 30px; margin-right: 0px">
				<table border="0" cellpadding="0" cellspacing="0" width="95%" style="position:relative;left:800px;top:-80px">
					<tr>
						<td width="10%"><input type="submit" value="查找" 
							class="btn btn-info" /></td>
						<td width="10%"><input type="button" class="btn btn-info" style="position:relative;left:-60px"
							value="新增" onclick="window.location.href('<%=basePath%>moduls/archive/addEmployee.jsp')"></td>
						<td width="10%"><input type="reset" style="position:relative;left:-120px" value="重置" class="btn btn-info" /></td>
						<td width="60%">&nbsp;</td>
					</tr>
				</table>
				</div>
			
				<p></p>
			
				<div style="margin-left: 30px; margin-right: 0px">
				<table width="90%" border="0" cellpadding="0" cellspacing="0" class="table table-striped">
					<tr>
						<td width="5%" class="td_title">删除</td>
						<td width="5%" class="td_title">修改</td>
						<td width="10%" class="td_title">员工编号</td>
						<td width="15%" class="td_title">员工名称</td>
						<td width="15%" class="td_title">出生年月日</td>
						<td width="8%" class="td_title">员工性别</td>
						<td width="19%" class="td_title">员工电话</td>
						<td width="15%" class="td_title">员工Email</td>
					</tr>
					<c:if test="${!empty requestScope.employees}">
						<c:forEach items="${requestScope.employees}" var="emp">
							<tr>
								<td class="td_border" align="center">
									<a href="javascript:deleteRecord('deleteEmployeeByIdAction?id=${emp.id}')">
										<img src="image/wrong.gif" border="0"/>
									</a>
								</td>
								<td class="td_border" align="center">
									<a href="findEmployeeByIdAction?id=${emp.id}">
										<img src="image/edit.gif" border="0"/>
									</a>
								</td>
								<td class="td_border">${emp.code}</td>
								<td class="td_border">${emp.name}</td>
								<td class="td_border">${emp.birthday}</td>
								<td class="td_border"><c:if test="${emp.sex}">男</c:if> <c:if
									test="${!emp.sex}">女 </c:if></td>
								<td class="td_border">${emp.telephone}</td>
								<td class="td_border">${emp.email}</td>
							</tr>
						</c:forEach>
					</c:if>
				</table>
			
				</div>
			</form:form>
		</div>
	



</body>
</html>